package org.spark.sql.scala.imooc

import org.apache.spark.sql.SQLContext
import org.spark.sparkUtil.SparkScalaContextUtil

/**
  * 功能概述:
  * Datetime:    2020/6/4   20:08
  * Author:   某人的目光
  */
object SQLContextApp {

  def main(args: Array[String]): Unit = {
    //1)创建相应的Context
    val sc = SparkScalaContextUtil.getSparkStart("SQLContextApp");
    val sqlContext = new SQLContext(sc)

    //2)相关的处理: json
    val people = sqlContext.read.format("json").load("D:\\学习Code\\大数据\\spark\\spark入门到精通\\spark-zero\\src\\main\\resources\\logs\\students.json");
    people.printSchema()
    people.show()


    //3)关闭资源
    sc.stop()
  }

}
